﻿@using Hiwjcn.Web.Models.Page;
@using WebLogic.Model.Page;
@{
    Layout = null;

    var model = ViewData["model"] as PageViewModel;
    if (model == null) { model = new PageViewModel(); }
    if (model.Page == null) { model.Page = new SectionModel(); }
}

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- header page -->
    @Html.Partial(IncludePath("header"))
</head>

<body>
    @Html.Partial(IncludePath("body_top"))
    <!--导航-->
    @Html.Partial(IncludePath("nav"))

    <div class="container" style="margin-top:20px;">
        <div class="row">
            @if (ValidateHelper.IsPlumpList(model.PageList))
            {
                <div class="col-md-3">
                    <div class="list-group">
                        @foreach (var page in model.PageList)
                        {
                            var cls = page.SectionName == model.CurrentPageName ? "list-group-item active" : "list-group-item";
                            <a class="@(cls)" href="/page/show/@(page.SectionName)/" target="_self">@(page.SectionTitle)</a>
                        }
                    </div>
                </div>
                <div class="col-md-9">
                    <div class="panel panel-default">
                        <div class="panel-heading">@(model.Page.SectionTitle)</div>
                        <div class="panel-body html_con">
                            @(Html.Raw(model.Page.SectionContent))
                        </div>
                    </div>
                </div> 
            }
            else
            {
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">@(model.Page.SectionTitle)</div>
                        <div class="panel-body html_con">
                            @(Html.Raw(model.Page.SectionContent))
                        </div>
                    </div>
                </div> 
            }
        </div>
    </div>

    @Html.Partial(IncludePath("footer"))
    @Html.Partial(IncludePath("body_bottom"))
</body>
</html>
